;(function(){
    $.ajax({
        url: "data/data5.json", //json文件位置
        type: "get",
        dataType: "json", //返回数据格式为json
        success: function (data){
          // import * as echarts from 'echarts';
            var chartDom = document.getElementById('main5');
            var myChart = echarts.init(chartDom, 'dark');
            // var myChart = echarts.init(chartDom, 'dark');
            var option;
            
            option = {
			title: {
			  text: '毕业生就业公司类型',
			  // subtext: 'By ecStat.regression',
			  sublink: 'https://github.com/ecomfe/echarts-stat',
			  left: 'center'
			},
              background:'',
              darkMode: true,
              dataset: {
                source: data.data5
              },
              grid: { containLabel: true },
              xAxis: { name: '人数' },
              yAxis: { type: 'category' },
              visualMap: {
                orient: 'horizontal',
                left: 'center',
                min: 0,
                max: 80000,
                show:true,
                text: ['高水平', '低水平'],
                // Map the score column to color
                dimension: 0,
                inRange: {
                  color: ['#65B581', '#FFCE34', '#FD665F']
                }
              },
              series: [
                {
                  type: 'bar',
                  encode: {
                    // Map the "amount" column to X axis.
                    x: 'amount',
                    // Map the "product" column to Y axis
                    y: 'product'
                  }
                }
              ]
            };
            
            option && myChart.setOption(option);
        }
    })

   
    
})();